package com.jk1123.reference.hard;

import java.util.ArrayList;
import java.util.List;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2021-08-20 18:44
 * @description
 *
 * 填写虚拟机启动参数
 * -Xmx2m -Xms2m
 * 内存不会垃圾回收
 *
 */
public class HardTest {

    public static void main(String[] args) {
        int num=0;
        List list=new ArrayList();
        while (true){
            byte[] buff=new byte[1024*1024];
            list.add(buff);
            //System.gc();
            System.out.println("第"+(++num)+"次");
        }







    }
}
